<!--
 * @Author: lisong
 * @Date: 2023-04-17 16:22:20
 * @LastEditors: lisong
 * @LastEditTime: 2023-04-24 16:38:38
 * @Description: 申报列表
-->
<template>
  <rk-grid
    ref="rkGridRef"
    title=""
    :boxConfig="false"
    :seqConfig="true"
    dataUrl="/alternateProject/queryAlternateProjectSqjl"
    :params="queryParams"
    :columns="tableColumns"
    :pagerConfig="false"
    :toolbarConfig="false"
  >
  </rk-grid>
</template>

<script setup name="ProjectDeclareTable">
// 向上触发的方法
const emits = defineEmits([
  'setFormItemValue'
])
const loading = ref(false)

const props = defineProps({
  // 组件的名称，用于组织插槽数据，提供给表单设计器以及渲染器（必须定义）
  title: {type: String, default: '项目申报记录'},
  // 表单数据信息
  formData: {type: Object, default: () => {
    return {
      proId: 'test'
    }
  }}
})

// ----- 表格相关操作
// 表格的模板引用
const rkGridRef = ref()
const queryParams = ref({
  proId: props.formData.proId
})
const tableColumns = ref([
  { field: 'agencyName', title: '申报单位', width: 250, align: 'left' },
  { field: 'proName', title: '项目名称', width: 310, align: 'left' },
  { field: 'proCode', title: '项目编码', width: 150, align: 'left' },
  { field: 'fiscalYear', title: '年度', width: 100, align: 'left' },
  { field: 'bondTypeName', title: '申请类型', width: 100, align: 'left' },
  { field: 'applyAmt', title: '申请金额(万元)', width: 150, align: 'center' },
  { field: 'applyDate', title: '申报日期', width: 120, align: 'left' },
  { field: 'setupYear', title: '立项年度', width: 100, align: 'left' },
  { field: 'proTypeName', title: '项目类型', width: 150, align: 'left' },
  { field: 'proCapital', title: '项目总概算', width: 150, align: 'left' },
  { field: 'startDate', title: '开工日期', width: 150, align: 'left' },
  { field: 'endDate', title: '竣工日期', width: 150, align: 'left' },
  { field: 'buildStatusName', title: '建设状态', width: 150, align: 'left' },
  // { field: 'Field2', title: '上报审核意见', width: 150, align: 'left' },
  // { field: 'Field3', title: '状态', width: 150, align: 'left' },
  // { field: 'Field4', title: '备注', width: 150, align: 'left' },
])
const tableData = ref([
  {
    "ID": "3CEF4D58BD8D42E09D6DFDBC95497BC1",
    "AG_ID": "C78D6FB40E845DAA606517726E6112A",
    "AG_CODE": "161000",
    "AG_NAME": "161000 2100161000单位",
    "XM_ID": "C73C3F58E4AB4DF4961265F65A042629",
    "XM_CODE": "P222100-0027",
    "XM_NAME": "测试_评分_lyx",
    "BILL_YEAR": "2022",
    "BILL_MONTH": null,
    "BOND_TYPE_NAME": "一般债券",
    "NODE_CURRENT_ID": 2,
    "AD_LEVEL_NAME": "21测试地区",
    "HZ_WF_STATUS": "001",
    "APPLY_AMOUNT_TOTAL": 0,
    "APPLY_AMOUNT1": 1,
    "APPLY_ZBJ_AMT": 0,
    "SB_AD_CODE": null,
    "RETURN_CAPITAL": 0,
    "BILL_NO": null,
    "APPLY_DATE": "2022-05-10",
    "APPLY_INPUTOR": "2100债务经办",
    "LX_YEAR": "2022",
    "JSXZ_NAME": null,
    "XMXZ_NAME": "公益性项目",
    "XMLX_NAME": "政府收费高速公路",
    "IS_FXJH": 3,
    "SBBATCH_NO_NAME": "辽宁一般批次",
    "START_DATE_PLAN": "2022-05-05",
    "END_DATE_PLAN": "2022-06-03",
    "START_DATE_ACTUAL": "2022-05-05",
    "END_DATE_ACTUAL": "2022-06-03",
    "BUILD_STATUS_NAME": "未开工",
    "FILTER_STATUS_NAME": "通过",
    "FIRST_BILL": "1",
    "SBZT": "1",
    "SB_AD_NAME": null,
    "SBYJ": null,
    "REMARK": null,
    "IS_VALID": 1,
    "JHGL_END": 1,
    "IS_USED": 0,
    "IS_END": "1",
    "ZQQX_NAME": "1年",
    "STATUS": "25",
    "TZLB": null,
    "TZLX_NAME": null,
    "TZ_REASON": null,
    "IS_XMZBJ": 0,
    "ZJTXLY_NAME": "铁路",
    "ZJTXLY_ID": "0201",
    "IS_FGW_LIST": null,
    "FGW_XMK_CODE": "1111-111111-11-11-111111",
    "BNLJ_SBCS": 1,
    "LSLJ_SBCS": 1,
    "PRE_DATE": "2022-05-10",
    "BOND_TYPE_ID": "01",
    "XMZGS_AMT": 1
  }
])

// ----- emits 方法定义
/**
 * 向上触发的方法，修改表单中的字段信息
 *
 * @param {String} fieldName 字段名称
 * @param {String} fieldValue 字段值
 */
const emitSetFormItemValue = function (fieldName, fieldValue) {
  emits('setFormItemValue', fieldName, fieldValue)
}

// ----- 获取组件数据
/**
 * 获取投资计划数据的方法，暴露给表单调用，固定名称getCompData
 */
const getCompData = function () {
  const {fullData} = rkGridRef.value.getTableData()
  return {
    'reviewApply_data': JSON.parse(JSON.stringify(fullData))
  }
}


defineExpose({
  getCompData
})

</script>

<style lang="scss" scoped>
:deep(.gs-cell-bg) {
  background-color: #e6e6e6;
}
</style>
